package com.ysy.logistics.service.sale.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ysy.logistics.entities.sale.CusOrderGoods;
import com.ysy.logistics.mapper.sale.CusOrderGoodsMapper;
import com.ysy.logistics.service.sale.CusOrderGoodsService;
import io.micrometer.common.util.StringUtils;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * @ClassDescription:
 * @Author:姚斯羽
 * @Create:2025/4/9 22:49
 **/
@Service
public class CusOrderGoodsServiceImpl extends ServiceImpl<CusOrderGoodsMapper, CusOrderGoods> implements CusOrderGoodsService {
    @Resource
    private CusOrderGoodsMapper cusOrderGoodsMapper;
    @Override
    public Long totalGoods(String orderId, String goodsId) {
        if (StringUtils.isBlank(orderId) && StringUtils.isBlank(goodsId)){
            return 0L;
        }
        return cusOrderGoodsMapper.totalGoodsNumByOrderIdAndGoodsId(orderId,goodsId);

    }
}
